
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h2>欢迎来自 <%-from%>!!!</h2>
    <h2>用户名 <%-username%>!!!</h2>
    <h2>评论 <%-text%>!!!</h2>
    <% if (username) { %>
        <form action="/updateText" method="post" name="form">
            添加评论：<input type="text" name="text" value="" placeholder="请输入评论内容">
            <input type="submit" value="发表">
            <input type="button" value="点赞" onclick="send()"/>
        </form>
    <% } else { %>
      <a href="/login">去登录</a>
    <% } %>
</body>
</html>



<script>
    function send(){
        console.log("send");
       document.querySelector('#text').value='赞！赞！赞！' 
       
    }
</script>